package org.NooLab.randomgraph.properties;


public class RGraphPropertiesDefaults {

	
	RGraphProperties rgProperties;
	private String startupTraceInfo;

	
	
	// ========================================================================
	public RGraphPropertiesDefaults(RGraphProperties rgProperties) {
		this.rgProperties = rgProperties;
	}
	// ========================================================================

	
	public String getStartupTraceInfo() {
		if ((startupTraceInfo==null) ||(startupTraceInfo.length()==0)){
			prepareStartupTraceInfo();
		}
		return startupTraceInfo;
	}

	/**
	 * 
	 * called after all settings have been defined
	 * creating a simple string that is used to create a "boot file": SomFluid then is able to know 
	 * about the project of the last run, in case a "resume" is requested
	 * 
	 * @return
	 */
	public void prepareStartupTraceInfo() {
		
		String cfgroot, userdir, lastproject, infoStr="";
		
		
		cfgroot =  rgProperties.getSystemRootDir() ;
		lastproject = rgProperties.getPersistenceSettings().getProjectName() ;
		
		// TODO better -> several categories: load file, modify it, write it back
		infoStr =  "cfgroot::"+cfgroot+"\n" +
		           "project::"+lastproject+"\n" ;
				                           	   

		
		startupTraceInfo = infoStr;
	}
	
	
	

}
